<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org" xmlns:hh="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>修改睡眠记录</title>
    <link rel="stylesheet" th:href="@{/css/bootstrap.css}">
</head>
<body>
<br/>
<br/>
<br/>
<h1 style="text-align: center">修改睡眠记录</h1>
<br/><br/>
<!--表单-->
<div style="width: 80%; margin: auto 70px" >
    <form class="form-horizontal" action="/sleep/update" method="post" th:object="${sleep}">
        <!--id-->
        <input type="hidden" name="sid" th:value="*{sid}"/>
        <!--用户名-->
        <div class="form-group">
            <label for="username" class="col-sm-2 control-label">用户名</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" name="username" id="username"
                        th:value="*{userName}" placeholder="用户名" th:disabled="true"/>
            </div>
        </div>
        <!--睡眠时间-->
        <div class="form-group">
            <label for="sTime" class="col-sm-2 control-label">睡眠时间</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" name="sTime" id="sTime"
                       th:value="*{sTime}" placeholder="睡眠时间"/>
            </div>
        </div>
        <!--睡眠周期个数-->
        <div class="form-group">
            <label for="sCycle" class="col-sm-2 control-label">睡眠周期个数</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" name="sCycle" id="sCycle"
                       th:value="*{sCycle}" placeholder="睡眠周期个数"/>
            </div>
        </div>
        <!--睡眠类型-->
        <div class="form-group">
            <label for="sType" class="col-sm-2 control-label">睡眠类型</label>
            <div class="col-sm-10">
                <select name="sType" id="sType" class="form-control">
                    <option th:value="1" th:text="晚上睡觉" th:selected="*{sType == 1}"/>
                    <option th:value="2" th:text="午睡" th:selected="*{sType == 2}"/>
                </select>
            </div>
        </div>
        <!--睡眠记录所在日期-->
        <div class="form-group">
            <label for="sDate" class="col-sm-2 control-label">睡眠记录所在日期</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" name="sDate" id="sDate"
                       th:value="*{#dates.format(sDate, 'yyyy-MM-dd')}" placeholder="睡眠记录所在日期"/>
            </div>
        </div>
        <!--按钮-->
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <input type="submit" value="修改" class="btn btn-info"/>
                <input type="reset" value="重置" class="btn btn-info"/>
            </div>
        </div>
    </form>
</div>
</body>
</html>